package cn.akwangl.design.pattern.behavioral.observerpattern.v2;

import java.util.ArrayList;
import java.util.List;

/**
 * 汇率.观察者模式.
 *
 * @author youyongkun
 * @date 2021/12/6 16:10
 */
public abstract class Rate {
    protected List<Company> companyList = new ArrayList<>();

    public void add(Company company) {
        companyList.add(company);
    }

    public void delete(Company company) {
        companyList.remove(company);
    }

    /**
     * 检查汇率.
     *
     * @param number 汇率
     * @author youyongkun
     * @date 2021/12/6 16:07
     */
    public abstract void change(int number);
}
